# Maintainer: David Runge <dvzrv@archlinux.org>

_name=geopy
pkgname=python-geopy
pkgver=2.3.0
pkgrel=2
pkgdesc="Geocoding library for Python"
arch=(any)
url="https://github.com/geopy/geopy"
license=(MIT)
depends=(python-geographiclib)
makedepends=(python-build python-installer python-setuptools python-wheel)
checkdepends=(python-aiohttp python-async_generator python-pytest-asyncio
python-pytest-aiohttp python-pytest python-pytz python-requests)
optdepends=(
  'python-aiohttp: for async http support'
  'python-requests: for requests support'
  'python-pytz: for timezone support'
)
source=(https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz{,.asc})
sha512sums=('bb9409dddd03f609335cdf1d3f2925e179d51ae3697b399404052d7dd1449e48a27ae6c142bdc0b07c45c309753111a213d9aac378bb3d193be8b6230df031a0'
            'SKIP')
b2sums=('dd2143a28096b855ccdd4e8b71249102db3e893a734bc6faf0384d3a9010d28b53575a3fe37a079b2cd66574179a23efcc38d3c42a0c5b190225be8b9e06e702'
        'SKIP')
validpgpkeys=('A18FE9F6F570D5B4E1E1853FAA7B5406547AF062') # Kostya Esmukov <kostya@esmukov.ru>

build() {
  cd $_name-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $_name-$pkgver
  pytest -vv --ignore='test/geocoders'
}

package() {
  cd $_name-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm 644 {AUTHORS,README.rst} -t "$pkgdir/usr/share/doc/$pkgname/"
  install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
}
